UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6D8HSkw0Oi6FhAu7uMZpAYW/Ln/EHucoBOBUyG0CUU0=' 
WHERE 
  key_id = 'b484270220e747eac0ce81af82b78296f78241611c056a99be84c3e7eccb5538' 
  AND (
    token = '6D8HSkw0Oi6FhAu7uMZpAYW/Ln/EHucoBOBUyG0CUU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018