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