UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F9z/FVo+WuTDrstmyfgkAnA6XzfiYlz8upBWfwChXCk='
WHERE
key_id = '4bd92873d39a1e10875f329a7b037cd596ddf912b6a2bc7ba4247082cf66c9fc'
AND (
token = 'F9z/FVo+WuTDrstmyfgkAnA6XzfiYlz8upBWfwChXCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)