UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJuHHIAZvkqaCZRvBDJq8joq4gFTaP+X3ZsTDNqFl4g='
WHERE
key_id = '2d11a7b788ccff975e227247dfff30e87633b70df8e8399f8f8d64b0975ce9b7'
AND (
token = 'mJuHHIAZvkqaCZRvBDJq8joq4gFTaP+X3ZsTDNqFl4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)