UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkLWXhyO8ZvXhpmB/Vjhkm2DWldt6T1CcxTHhBJC9tU=' 
WHERE 
  key_id = 'c35d033b315f6ebd25cdc2c9e4cfc8b84e8d722c1663dda8110e8147ebcc7ba0' 
  AND (
    token = 'hkLWXhyO8ZvXhpmB/Vjhkm2DWldt6T1CcxTHhBJC9tU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047