UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PhM8ekTTzTjWe39d/B57RQU2a0padeCNoPvqSSiYjHE='
WHERE
key_id = 'fc1c0dedbbdec00ea46a09ca3381c7c5d195d568b61c70a06bb000980962f23f'
AND (
token = 'PhM8ekTTzTjWe39d/B57RQU2a0padeCNoPvqSSiYjHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)