UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TtrLCL3lufPlyWyBapTCSPcpCc3J9jv4HavBXQ4XeRs='
WHERE
key_id = '6fc5d42467c13208c5cf8ea0ad1a9acb99884b26db314a5fe4a772bbe35da5a3'
AND (
token = 'TtrLCL3lufPlyWyBapTCSPcpCc3J9jv4HavBXQ4XeRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)