UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1zTFIWCTGtHgWzuP44eVWbkXIXFqtntTAPpVEBv/KnM=' 
WHERE 
  key_id = 'f068464d7ad4023a9053f88e615648da17f10cb9b9e63109748d998c2c2d6115' 
  AND (
    token = '1zTFIWCTGtHgWzuP44eVWbkXIXFqtntTAPpVEBv/KnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021