UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PeTE9OW3OrcCnlpGipF3PqqAV0Ymm6bEMSuvo/pdg4Y='
WHERE
key_id = 'c47a37dd229b2ed24f273b1ba729b61ba9ee7ab55f8fb30949e9e39a79e1441b'
AND (
token = 'PeTE9OW3OrcCnlpGipF3PqqAV0Ymm6bEMSuvo/pdg4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)