UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QsR9OY2BasH0Yqx2gqze7jxyZ5YzzouaYR0VW/Fhj/E=' 
WHERE 
  key_id = '3adb6da7d034115b6a3c04dead0bca037a280bc79b19fb77a1863bdbb45cfd1f' 
  AND (
    token = 'QsR9OY2BasH0Yqx2gqze7jxyZ5YzzouaYR0VW/Fhj/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029