UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pOVXNkmNgsKYL3le710TCOT1K7Bc5FtUgqm4T8Jd6Z8='
WHERE
key_id = '7218b5355dc47033cdc71cc3221e9db4bc561c02ef2cc5f393a5f77ec7e705bd'
AND (
token = 'pOVXNkmNgsKYL3le710TCOT1K7Bc5FtUgqm4T8Jd6Z8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)