UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OnYM+Ba6BHHcMco3gJLKOxfVjVVbk0JdkbUEXfzfrWU=' 
WHERE 
  key_id = 'e2976d29fd67f7fc09b1ca04b47e1553b35148c2e80203f83f8d1ab5e3e0ed94' 
  AND (
    token = 'OnYM+Ba6BHHcMco3gJLKOxfVjVVbk0JdkbUEXfzfrWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031