UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qT9dTFEdyJjSLOi0JR3Pf94gNytbonTMNN/QbjuKSCU='
WHERE
key_id = 'ca317e8e95c165f42f071bb208babc108c80082ad24a47e877a8b9d1f5a5c4fd'
AND (
token = 'qT9dTFEdyJjSLOi0JR3Pf94gNytbonTMNN/QbjuKSCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)