UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VWfzFGoEgOMWJIBlovCj4Z7cdT/dk1c1cfZK3tUtffA=' 
WHERE 
  key_id = '8c1f24aef6963c13e2c5f8747dba7de35cbf54e12c12c760e0f1937787bfb2db' 
  AND (
    token = 'VWfzFGoEgOMWJIBlovCj4Z7cdT/dk1c1cfZK3tUtffA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021