UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p/3p/0RRT+dMQowQlSme5+SbRebUBrUZBeqw00C1Nbg=' 
WHERE 
  key_id = '3e275a5425c46e6f11648816426a94e2c354eb0b41d5c95cf5ee1cfa97d12d92' 
  AND (
    token = 'p/3p/0RRT+dMQowQlSme5+SbRebUBrUZBeqw00C1Nbg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060