UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sSwLd7jnzqQ8J4o2XQvYiTYwEwZArwZB0JblL6NCcS8=' 
WHERE 
  key_id = '1d35e61fed496cbf8a663cda537330d9b47bddf331d6fd27ac42f39c2ebf914b' 
  AND (
    token = 'sSwLd7jnzqQ8J4o2XQvYiTYwEwZArwZB0JblL6NCcS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034