UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jkhqvtKl9gxxhABD7FL9k8UapBFIzCMtuf2m0MkSff8='
WHERE
key_id = '72e7efb5d01579768ee42cb15b7ad224d7d87b7daf3253eb3af43611fe6a4e3e'
AND (
token = 'jkhqvtKl9gxxhABD7FL9k8UapBFIzCMtuf2m0MkSff8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)