UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PaW0a7zeIrZ4b5QIkyqL/QQ61NHB+XXRN2auLyf+XkE='
WHERE
key_id = '713794541ba4d38c82a02c0d5a4cce41f037bc141a59c9d5b820c0148ae02a06'
AND (
token = 'PaW0a7zeIrZ4b5QIkyqL/QQ61NHB+XXRN2auLyf+XkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)