UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MDqEZTKRl/9I9yp1+YeYnfKwmJz4qiNkn2M6mFXp9pQ=' 
WHERE 
  key_id = 'c6ae9ec605dcbdb5eb62848ccf3816137cf5d7372071aa8b96c4e8cb3fe1b77c' 
  AND (
    token = 'MDqEZTKRl/9I9yp1+YeYnfKwmJz4qiNkn2M6mFXp9pQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030