UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wmb2GkGtzeZ5PYftnJDzz5rJclYA0GcpsV7CR8pdf9Y=' 
WHERE 
  key_id = 'e23e83b5491b5061715c4f41b97a3a58f94c0eb8e0101f7df7bf0d1ea1a31dcb' 
  AND (
    token = 'Wmb2GkGtzeZ5PYftnJDzz5rJclYA0GcpsV7CR8pdf9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040