UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PUseyPQNJDQ6pN9FosxI1Jf/xBsA2W4A3LPWqNa/u5Y=' 
WHERE 
  key_id = '55e57c79c8b8ba5dd234fd11508ad882d4471bb5941c3efd2df7fea313c03483' 
  AND (
    token = 'PUseyPQNJDQ6pN9FosxI1Jf/xBsA2W4A3LPWqNa/u5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038