UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMHnsdBrlxIZqbOFDkVtRu8CPfaoHfIByg6clJNT2vg='
WHERE
key_id = '852e550de77930c32c65dcaf05d0fb603cf2c811d74ce6b6ff18dc36669c96e4'
AND (
token = 'CMHnsdBrlxIZqbOFDkVtRu8CPfaoHfIByg6clJNT2vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)