UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XTwRBMQEuc53dYQyoDgMbmEATjnbL+g9l0fWvf5I0AE='
WHERE
key_id = 'cba1d73c2d57ac5e7a29404f4e625d5a3e9a39885a8b8d8e6e57c272e84aa0ab'
AND (
token = 'XTwRBMQEuc53dYQyoDgMbmEATjnbL+g9l0fWvf5I0AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)