UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2JOwlm3t6l7DcmmK7rJSpRfRtACqlcKpnPP7yPhf59g='
WHERE
key_id = '56d84348fa43dcd90866d43d7b352c17702c77909aa427a4da4b8b22a0acedc7'
AND (
token = '2JOwlm3t6l7DcmmK7rJSpRfRtACqlcKpnPP7yPhf59g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)