UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P2BjMkt5ff41lH6QcaHmYL0GJgc/li9wRCCDjEe3r1Q='
WHERE
key_id = '08760507007b5409c8d36372e12cba1ee5a84987be167676551ed3613ac66e7a'
AND (
token = 'P2BjMkt5ff41lH6QcaHmYL0GJgc/li9wRCCDjEe3r1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)