UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w/Cu63YNIiIOgvdfu+GkBYeQBFHTmJ8bc7OTSmcoE80=' 
WHERE 
  key_id = 'ae080e06353bfeecd3e1e6ba78a21a5467fc61ad632b81235ba80c7e68689001' 
  AND (
    token = 'w/Cu63YNIiIOgvdfu+GkBYeQBFHTmJ8bc7OTSmcoE80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025