UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l3o+RqsGnnPvj5o0HzBfO/hkdb3h6P9fSGv3qI51L2U='
WHERE
key_id = 'efd555fea85555e87d33cd33e65373b3af8a5a58ccccd320a7942e853e9b14e1'
AND (
token = 'l3o+RqsGnnPvj5o0HzBfO/hkdb3h6P9fSGv3qI51L2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)