UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D2GUEfv5+j9rey1qIkgga8r6HxbYYGqXCypGhQiT4gs=' 
WHERE 
  key_id = 'c8d3fb158da2c05882d050534fb47626535dabc6f1cbbe170b7445a52316249c' 
  AND (
    token = 'D2GUEfv5+j9rey1qIkgga8r6HxbYYGqXCypGhQiT4gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028