UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yq3lc2qUuXfboY62ZgBVWxLvfXRklR6L2fdqzINyG2U=' 
WHERE 
  key_id = '9ebfd9edb11a84a6a3e41c474ed823587b4bcb2f88ebdda23b7dc71a6820ede2' 
  AND (
    token = 'yq3lc2qUuXfboY62ZgBVWxLvfXRklR6L2fdqzINyG2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043