UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1rMm8pAZM1WPN9VVozXW0ya2X/FjFIhqTnjwwZiliT4='
WHERE
key_id = '8d1cc88fe5a981c74a54ac9ad65b555236e3a8fcc428510f7a3e02106a852c58'
AND (
token = '1rMm8pAZM1WPN9VVozXW0ya2X/FjFIhqTnjwwZiliT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)