UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cISQEPHxb/BiYJL4vz309/srdmjEHnT8bmflDVa6qbQ='
WHERE
key_id = '24c03ea6f5c5b92adac30e6dd6c7b511fd2404bcae89b9f30ee80bb719e87f66'
AND (
token = 'cISQEPHxb/BiYJL4vz309/srdmjEHnT8bmflDVa6qbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)