UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wO2AZhbNBzQMlDvVhrRmzCIukDvEVeNlgYjeGApmpLA='
WHERE
key_id = 'b29c70744be5cb41caf93f1e001f844f6a888b7895aea280df32d02aff36b021'
AND (
token = 'wO2AZhbNBzQMlDvVhrRmzCIukDvEVeNlgYjeGApmpLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)