UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eCaRu/VX6VrZQSzyJcOEHyFLi8sF/CKnhGyeu8aTmvk='
WHERE
key_id = '0bffa15b9990d50e8d71a450d892b9f3d039d5effc4fe9eacbae7dafb0aea143'
AND (
token = 'eCaRu/VX6VrZQSzyJcOEHyFLi8sF/CKnhGyeu8aTmvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)