UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8o0m0zZjgK60//a9K56Ng8De7wehEXl1eQz48fdCbU=' 
WHERE 
  key_id = '9aad9c98c6a455c3fdaef4299d9cebbb43f5409bc6def23b8f99de0cc4eafca2' 
  AND (
    token = 'X8o0m0zZjgK60//a9K56Ng8De7wehEXl1eQz48fdCbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021