UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RGpfsEuxCaFaDTliN2ZtBDkbpiIJRh80ysH3HEzEQYU=' 
WHERE 
  key_id = '8d32c9aac25c3a87b048e039ea751a3fbcdb4dd99eaed6393a930bdf355128d5' 
  AND (
    token = 'RGpfsEuxCaFaDTliN2ZtBDkbpiIJRh80ysH3HEzEQYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028