UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q1Ypy6CqKrrEWPssupso3uSxXIBSyn7xCRWOUYZmpsM='
WHERE
key_id = '888c56fdbe714d91ff012541ac24fd6019a3e9bd37b817dc6b1659a2b02134d8'
AND (
token = 'q1Ypy6CqKrrEWPssupso3uSxXIBSyn7xCRWOUYZmpsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)