UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dhOPGEEX/oZYgsXs7me5b0LGO20y5ob7/GQ/kNawmiA=' 
WHERE 
  key_id = 'ddc92883d4a89a25feeb48b321404414755335eea26aad77741c1c0a03d15c57' 
  AND (
    token = 'dhOPGEEX/oZYgsXs7me5b0LGO20y5ob7/GQ/kNawmiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036