UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRlXLQic4aq+gDd5obPuHjMoAmdE2Ogd+J5LddBhbGY=' 
WHERE 
  key_id = 'fff2816874e88c21faff051e9740038fd3800568c9a6e85691e4a37fc0cd06b2' 
  AND (
    token = 'WRlXLQic4aq+gDd5obPuHjMoAmdE2Ogd+J5LddBhbGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032