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

Query time 0.00042