UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evX8ThsatC02MvXUJDlWkzBirvPlEH/RJWDZCjxbllQ=' 
WHERE 
  key_id = '7cd757ea7ae350a990466e6c2828fac397f58323a106199dbd7b7c655fee492c' 
  AND (
    token = 'evX8ThsatC02MvXUJDlWkzBirvPlEH/RJWDZCjxbllQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032