UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QnLz/XeGZYYPjN5YZMWOeWcaCSRWj2QB+9MBkxdPCMQ='
WHERE
key_id = '7bedf7ea4eba7207e93bfe0bd8d994e40cd53e705f3029c4f1c66a1b5a1012a3'
AND (
token = 'QnLz/XeGZYYPjN5YZMWOeWcaCSRWj2QB+9MBkxdPCMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)