UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p86pQ9kA5G2qPKlF9TviWXMFAEQIXathJABP4pDLdCY='
WHERE
key_id = '73e73343d4ce47c56ebab88d90da9900f08bf4817582229be60d965426fc0a3e'
AND (
token = 'p86pQ9kA5G2qPKlF9TviWXMFAEQIXathJABP4pDLdCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)