UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DJCDGmnjEDFWVJV8yO7VqCYd0RVkmukOVvqLLsntHug=' 
WHERE 
  key_id = '036ece7f25c40c2885b9c162c08c44801e9e7f4aba96d690a4540d50550e096b' 
  AND (
    token = 'DJCDGmnjEDFWVJV8yO7VqCYd0RVkmukOVvqLLsntHug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036