UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oZ0VmZ2plQX5JoCzNzMGhf4RLKkN0eViy0WiI3Yys7o=' 
WHERE 
  key_id = '3bc46dcfac23c2c58216ba2ea37f0271f3801214475cdcc920bf65a1ace90a7d' 
  AND (
    token = 'oZ0VmZ2plQX5JoCzNzMGhf4RLKkN0eViy0WiI3Yys7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042