UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WOT8B3PzXs0uSaCXc0HO1vBlHVIlA8wSXU5K0bi/jeg=' 
WHERE 
  key_id = 'b6b96212548c9025f9f9ff6a10a8a3fcada72dc610e94a53d9ac0c5282c0fd4f' 
  AND (
    token = 'WOT8B3PzXs0uSaCXc0HO1vBlHVIlA8wSXU5K0bi/jeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053