UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eauir/MQFKm1/R38TsQKw8c0dfpw7wRyHpgjoH26xH4='
WHERE
key_id = 'bf1878a0e50897eafa5a101650206560616cb0046f8229c8862f0e6729e03bb1'
AND (
token = 'eauir/MQFKm1/R38TsQKw8c0dfpw7wRyHpgjoH26xH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)