UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1XqmJhfAP/v8f0pdredjRk1/8KeO30WzfWhE4IrfGR4=' 
WHERE 
  key_id = 'cb6d1d9af12b144e40e11d15b3524088cf1fb0072c771c34a55221da329176fb' 
  AND (
    token = '1XqmJhfAP/v8f0pdredjRk1/8KeO30WzfWhE4IrfGR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036