UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vxA4z9w/kpDQW7yA4EGbVTVIcykuimuo3aoppt1A8kg='
WHERE
key_id = '02fc6e6d9e79dfe7bd09bb16d453a0c080b0ebc677a449ca83c92906028d71b3'
AND (
token = 'vxA4z9w/kpDQW7yA4EGbVTVIcykuimuo3aoppt1A8kg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)