UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/gX/K4MR+HfsLEJLMmD8J8zLQLIWbjjy982s4vtNpuM=' 
WHERE 
  key_id = '1defba52bc74d33bcf52aecbed2792efb6eef99fdc1da5efd61e3cf56f7b65e3' 
  AND (
    token = '/gX/K4MR+HfsLEJLMmD8J8zLQLIWbjjy982s4vtNpuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037